#!/usr/bin/perl
# USAGES: Perl Script to Genetrate MD5 hash.
# Author: AMIT MAHESHWARI
# Website : http://linux.amitmaheshwari.in/
# version: 0.1
# Script Starts
use strict;
use warnings;
use Digest::MD5 qw(md5 md5_hex md5_base64);
use Digest::SHA qw(sha1 sha1_hex sha1_base64);
use MIME::Base64;
my $password;
if (scalar @ARGV eq 1) {
$password = shift;
} else {
$password = "Amit";
}
print "MD5 hex digest of $password = ",md5_hex($password), "\n"; # human-readable
print "MD5 base64 digest of $password = ",md5_base64($password), "\n"; # human-readable too
print "SHA1 hex digest of $password = ",sha1_hex($password), "\n"; # human-readable
print "SHA1 base64 digest of $password = ",sha1_base64($password), "\n"; # human-readable too
# Script Ends